/**
 * Author:   .
 * Date:    2017/7/4 0004.
 * File：   .
 */
// 处理REM单位核心代码
function init() {
  var documentEl = document.documentElement
  var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'
  var recalc = function () {
    var clientWidth = documentEl.clientWidth
    documentEl.style.fontSize = 20 * (clientWidth / 320) + 'px'
    document.getElementsByTagName('body')[0].style.opacity = '1'
  }
  window.addEventListener(resizeEvt, recalc, false)
  document.addEventListener('DOMContentLoaded', recalc, false)
}

export {init}